<?php
	include_once('function/func.php');
?>
<h1><?=$titleCate;?></h1>
<input type="hidden" value="<?php ($this->session->userdata('start'))? print $this->session->userdata('start') : print 0 ?>" id="start" />
<input type="hidden" value="9" id="per_page" />
<input type="hidden" value="1" id="show_category" />
<input type="hidden" value="<?=$idCate;?>" id="id_category" />
			
<div class="products" id="page">
	<?php
		if($result){
			foreach($result as $r){
	?>
    <div class="one_products">
    	<?php if($r->price_new != 0 && $r->promotion != 0):?>
        <div class="sale"></div>
        <?php endif;?>
    	<div id="productImageWrapID_<?=$r->id?>">
        	<a title="<?=$r->title?>" href="<?=PATH_URL.'san-pham/chi-tiet/'.$r->id.''?>"><img src="<?=PATH_URL.IMAGES_PRODUCTS.$r->image.''?>" width="150" height="187" /></a>
        </div>
        <p>
            <a title="<?=$r->title?>" href="<?=PATH_URL.'san-pham/chi-tiet/'.$r->id.''?>"><?=cutString($r->title,45,$type=' ...')?></a>
        </p>
        <?php if($r->price_new != 0 && $r->promotion != 0){?>
        <div class="price_sellers">
            <strike><?=number_format($r->price_old,0,',','.');?> vnđ</strike>
            <h4 class="price"><?=number_format($r->price_new,0,',','.');?> vnđ</h4>
        </div>
        <?php }else{?>
        <h4 class="price"><?=number_format($r->price_old,0,',','.');?> vnđ</h4>
        <?php }?>
        <div class="button custom_cart" ><a href="#" id="featuredProduct_<?=$r->id?>" onclick="addCart(<?=$r->id?>); return false">Đặt hàng</a></div>
    </div>
    <?php }}?>
    <div class="pagination"><?=$this->adminpagination->create_links();?></div>
</div>